package com.roger.springcloudGreenwich.component;

import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;

@Component
public class UserHelper {

    public String getCurrentUser(HttpServletRequest request) throws Exception{
        String loginUser = request.getHeader("loginUser");
        return URLDecoder.decode(loginUser, StandardCharsets.UTF_8.toString());
    }
}
